<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>小米商城-添加手机</title>
    <link rel="stylesheet" type="text/css" href="./css/style.css">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.0/jquery.js"></script>
    <script>
        const ADDPHONE="http://localhost:8080/mi/AddPhone";    //获取指定手机

            //通过获取手机信息
            //placeholder
            $(function () {
                let name = localStorage.getItem("name");

                $("#dlname").text(name).attr("href","self_info.html");
                //点击提交按钮触发 将修改该后的数据保存到数据库

                $("#tj").click(function () {
                    alert("提交信息");
                    var iname = $('#uname').val();
                    var icolor = $('#ucolor').val();
                    var iimage = $('#uimage').val();
                    var istate = $('#ustate').val();
                    var ivalue = $('#uvalue').val();
                    var iPrince = $("#uPrince").val();
                    let phone ={
                        name:iname,
                        color:icolor,
                        price:iPrince,
                        image:iimage,
                        state:istate,
                        value:ivalue
                    }

                    $.post(ADDPHONE,phone,function (save) {
                        if(save){
                            //保存成功
                            alert("保存成功");
                        }else {
                            alert("保存失败");
                        }
                    })


                      })

                })


    </script>
</head>
<body>
<!-- start header -->
<header>
    <div class="top center">
        <div class="left fl">
            <ul>
                <li><a href="index.html" target="_blank">小米商城</a></li>
                <li>|</li>
                <li><a href="">MIUI</a></li>
                <li>|</li>
                <li><a href="">米聊</a></li>
                <li>|</li>
                <li><a href="">游戏</a></li>
                <li>|</li>
                <li><a href="">多看阅读</a></li>
                <li>|</li>
                <li><a href="">云服务</a></li>
                <li>|</li>
                <li><a href="">金融</a></li>
                <li>|</li>
                <li><a href="">小米商城移动版</a></li>
                <li>|</li>
                <li><a href="">问题反馈</a></li>
                <li>|</li>
                <li><a href="">Select Region</a></li>
                <div class="clear"></div>
            </ul>
        </div>
        <div class="right fr">
            <div class="gouwuche fr"><a href="./dingdanzhongxin.html">我的订单</a></div>
            <div class="fr">
                <ul>
                    <li><a href="./login.html" id="dlname" target="_blank">登录</a></li>
                    <li>|</li>
                    <li><a href="./register.html" target="_blank" >注册</a></li>
                    <li>|</li>
                    <li><a href="#top">个人中心</a></li>
                </ul>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</header>
<!--end header -->
<!-- start banner_x -->
<div class="banner_x center">
    <a href="./index.html" target="_blank"><div class="logo fl"></div></a>
    <a href=""><div class="ad_top fl"></div></a>
    <div class="nav fl">
        <ul>
            <li><a href="liebiao.html" target="_blank">小米手机</a></li>
            <li><a href="">红米</a></li>
            <li><a href="">平板·笔记本</a></li>
            <li><a href="">电视</a></li>
            <li><a href="">盒子·影音</a></li>
            <li><a href="">路由器</a></li>
            <li><a href="">智能硬件</a></li>
            <li><a href="">服务</a></li>
            <li><a href="">社区</a></li>
        </ul>
    </div>
    <div class="search fr">
        <form action="" method="post">
            <div class="text fl">
                <input type="text" class="shuru"  placeholder="小米6&nbsp;小米MIX现货">
            </div>
            <div class="submit fl">
                <input type="submit" class="sousuo" value="搜索"/>
            </div>
            <div class="clear"></div>
        </form>
        <div class="clear"></div>
    </div>
</div>
<!-- end banner_x -->
<!-- self_info -->
<div class="grzxbj">
    <div class="selfinfo center">
        <div class="lfnav fl">
            <div class="ddzx">订单中心</div>
            <div class="subddzx">
                <ul>
                    <li><a href="gouwuche.html" >我的购物车</a></li>
                   
                </ul>
            </div>
            <div class="ddzx">个人中心</div>
            <div class="subddzx">
                <ul>
                    <li><a href="./self_info.html" >我的个人中心</a></li>
                    <li><a href="zhengjiashouji.html"  style="color:#ff6700;font-weight:bold;">上架商品</a></li>

                </ul>
            </div>
        </div>
        <div class="rtcont fr">
            <div class="grzlbt ml40">手机资料</div>
            <div class="subgrzl ml40"><span>手机型号</span><span><input type="text" id="uname" maxlength="80" size="30" placeholder="小米6&nbsp;小米MIX">"</span></div>
            <div class="subgrzl ml40"><span>手机颜色</span><span><input type="text" id="ucolor" maxlength="80" size="30" placeholder="黑色"></span></div>
            <div class="subgrzl ml40"><span>手机图片</span><span><input type="text" id="uimage" maxlength="80" size="30"placeholder="123.jpg"></span></div>
            <div class="subgrzl ml40"><span>价格</span><span><input type="text" id="ustate" maxlength="80" size="30"placeholder="99999"></span></div>
            <div class="subgrzl ml40"><span>分类</span><span><input type="text" id="ufl" maxlength="80" size="30"placeholder="1或2"></span></div>
            <div class="subgrzl ml40"><span>库存</span><span><input type="text" id="uvalue" maxlength="80" size="30"placeholder="999999"></span></div>
            <div class="subgrzl ml40"style="text-align: center" ><span><button id="tj">添加</button></span></span></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<!-- self_info -->

<footer class="mt20 center" style="display: flex;justify-content: center;align-items: center;flex-direction: column;">
    <div class="mt20">小米商城|MIUI|米聊|多看书城|小米路由器|视频电话|小米天猫店|小米淘宝直营店|小米网盟|小米移动|隐私政策|Select Region</div>
    <div>©mi.com 京ICP证110507号 京ICP备10046444号 京公网安备11010802020134号 京网文[2014]0059-0009号</div>
    <div>违法和不良信息举报电话：185-0130-1238，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</div>
</footer>
</body>
</html>